$(document).ready(function(){
    $('.sym_user_profile form').submit(function(){
	$.ajax({
	    data:{
		'symbiont':'user.db_profile',
		'email':$('.sym_user_profile .email').val(),
		'firstname':$('.sym_user_profile .firstname').val(),
		'lastname':$('.sym_user_profile .lastname').val(),
		'city':$('.sym_user_profile .city').val(),
		'country':$('.sym_user_profile .country').val(),
		'phone':$('.sym_user_profile .phone').val(),
		'address':$('.sym_user_profile .address').val()
	    },
	    success:function(r){
		if(r.ok!=undefined){
		    $('.sym_user_profile .message').html(r.ok).removeClass('error').addClass('ok');
		    $('.sym_user_profile .form').fadeOut();
		}
		else if(r.error!=undefined){
		    $('.sym_user_profile .message').html(r.error).removeClass('ok').addClass('error');
		}
	    }
	});
	return false;
    });
});
